Silk Mobile

Table of Contents (Homepage)

Session 5 - Locating Application Elements

This session demonstrates two different ways to specify the location of an Element so that some action can be executed on it:

  1. Example 1: "SwipeWhileNotFound" command - Swipe to search for an element or text.

  2. Example 2: "ElementListSelect" command - Select an element in a list (after first making the element visible).

For this example we'll use the eri-Bank application. We will go to the payment page, click on the countries list, and choose United-Kingdom (which is the not visible unless scrolling down)

Preparations:

Step 1: We will do a native record on the eri-Bank application as explained in session 1 - "Getting Gtarted iOS / Android / WindowsPhone "

Step 2: Change the last command to "Click" on 'Make Payment' Object (instead of "VerifyElement").

  1. Click on the relevant step

  2. Expand the commands drop-down list

  3. Choose the wanted command (in this case - 'Click')

    images/download/attachments/2688014/1.jpg

    This is the new script:
    images/download/attachments/2688014/2.jpg

Step 3: Add a step - Click on 'Select' button (to open the countries list)

Note: We will do a dynamic NATIVE extraction

  1. Click on the "Object Spy" icon button.

  2. Click on the 'Select' button.

  3. Right-click on one of the Object's properties to Add a command -> choose 'Click'.

    images/download/attachments/2688014/3.jpg

    The Countries list will now appear on the device and the script will appear in the script area:

    images/download/attachments/2688014/4.jpg

Now we are ready to add the command that will find the country we want and then click on it - the country will be United-Kingdom'

  1. "SwipeWhileNotFound" command

  2. "ElementListSelect" command